package test;

import hibernate.HibernateUtil;
import java.util.List;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

import entity.*;

public class testHibernate {

	public static void main(String[] args)
	{
		SessionFactory sf =  HibernateUtil.getSessionFactory();
		Session session = sf.getCurrentSession();
		org.hibernate.Transaction t =  session.beginTransaction();
		EmpleadoEntity empleado = new EmpleadoEntity("Fernando", 33642069);
		session.save(empleado);
//		List <entity.EmpleadoEntity> res = session.createQuery("from Cliente c").list();
//		for(int i = 0; i<res.size();i++){ 
//			System.out.println("Nombre de Empleado " + res.get(i).getNombre());
//		}
		
		t.commit();
		System.out.println("Fin");
		sf.close();
		sf = null;
	}
}
